package com20230218;

import java.util.Arrays;

public class RoseFlower1 {
    public static void main(String[] args) {

        int[] arr1 = new int[10];
        rose(5);
//        arr1 = Arrays.copyOf(arr, arr.length);
        System.out.println(Arrays.toString(arr1));
    }

    public static int[] rose(int length) {
        int[] arr = new int[length];
        for (int i = 0; i < arr.length; i++) {
            for (int j = 1000; j < 10000; j++) {
                int q = j / 1000;
                int b = j / 100 % 10;
                int s = j / 10 % 10;
                int g = j % 10;
                if (Math.pow(q, 4) + Math.pow(b, 4) + Math.pow(s, 4) + Math.pow(g, 4) == j) {
                    arr[i] = j;
                    length++;
                }
            }
        }
        return arr;
    }

}
